home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-04-30 | 3.5 KB | 104 lines | [TEXT/MPCC] |
- //----------------------------------------------------------------------------------------
- // Part Activation protocol
- //----------------------------------------------------------------------------------------
-
- #ifndef _CREDITNOWDEMO_
- #include "CPCreditNowDemo.h"
- #endif
-
- //----------------------------------------------------------------------------------------
-
- ODBoolean CPCreditNowDemo::BeginRelinquishFocus(Environment* ev, ODTypeToken focus,
- ODFrame* ownerFrame,
- ODFrame* proposedFrame)
- {
- // CodeWarrior: Cmd-Click or Search:Find Definition • Explain_BeginRelinquishFocus
- EnteringMethod("\pCPCreditNowDemo::BeginRelinquishFocus");
- ODUnused(ownerFrame);
-
- if ((focus == fModalFocus) && (proposedFrame->GetPart(ev) != fSelf)) {
- return kODFalse;
- // What IS ModalFocus, anyway? The whole purpose of this
- // ModalFocus thing is to restrict frame changes. This is
- // the part's chance to do this. But how much to restrict…
- //
- // This is an interesting case. ModalFocus is kind of a weird
- // concept in OpenDoc, as it goes against the principal of
- // being able to click anywhere at any time. This implementation
- // keeps the focus on the part. Note that the implementation
- // of ModalFocus might be more restrictive than this. You may
- // wish to restrict it to a single frame, instead of allowing
- // the focus to move from frame to frame within a single part.
- // If you wish to restrict it to a single frame, then the if
- // should only check if it is a modal focus.
- }
- else {
- return kODTrue;
- // This is the super-script way of handling ModalFocus. You
- // can NOT switch off the frame to another, no matter what.
- }
- }
-
- //----------------------------------------------------------------------------------------
-
- void CPCreditNowDemo::CommitRelinquishFocus(Environment* ev,
- ODTypeToken focus, ODFrame* ownerFrame,
- ODFrame* proposedFrame)
- {
- // CodeWarrior: Cmd-Click or Search:Find Definition • Explain_CommitRelinquishFocus
- EnteringMethod("\pCPCreditNowDemo::CommitRelinquishFocus");
- ODUnused(proposedFrame);
-
- this->FocusLost(ev, focus, ownerFrame);
- }
-
- //----------------------------------------------------------------------------------------
-
- void CPCreditNowDemo::AbortRelinquishFocus(Environment* ev,
- ODTypeToken focus, ODFrame* ownerFrame,
- ODFrame* proposedFrame)
- {
- // CodeWarrior: Cmd-Click or Search:Find Definition • Explain_AbortRelinquishFocus
- EnteringMethod("\pCPCreditNowDemo::AbortRelinquishFocus");
- ODUnused(focus);
- ODUnused(ownerFrame);
- ODUnused(proposedFrame);
- }
-
- //----------------------------------------------------------------------------------------
-
- void CPCreditNowDemo::FocusAcquired(Environment* ev, ODTypeToken focus, ODFrame* ownerFrame)
- {
- // CodeWarrior: Cmd-Click or Search:Find Definition • Explain_FocusAcquired
- EnteringMethod("\pCPCreditNowDemo::FocusAcquired");
- if (focus == fMenuFocus)
- {
- if (ownerFrame && fMenuBar)
- {
- fMenuBar->Display(ev);
- }
- }
- //AET<<
- if (fCurrentField)
- (fCurrentField->GetTextField())->Activate();
- //AET>>
- }
-
- //----------------------------------------------------------------------------------------
-
- void CPCreditNowDemo::FocusLost(Environment* ev, ODTypeToken focus, ODFrame* ownerFrame)
- {
- // CodeWarrior: Cmd-Click or Search:Find Definition • Explain_FocusLost
- EnteringMethod("\pCPCreditNowDemo::FocusLost");
- ODUnused(ownerFrame);
-
- if (focus == fMenuFocus)
- {
- }
- //AET<<
- if (fCurrentField)
- (fCurrentField->GetTextField())->Deactivate();
- //AET>>
- }
-
-